

DEFINE BUFFER sct FOR sct_det .

/* OUTPUT TO C:\qadguicli\my.txt.*/ 

FOR EACH sct_det NO-LOCK WHERE sct_det.sct_site = "500" AND sct_det.sct_sim = "standard" AND (sct_det.sct_part BEGINS "231") AND sct_det.sct_cst_tot  = 0:

    FIND FIRST sct NO-LOCK WHERE SUBSTRING(sct.sct_part,1,11,"CHARACTER") = SUBSTRING(sct_det.sct_part,1,11,"CHARACTER") AND sct.sct_site = "500" AND sct.sct_sim = "standard".
    IF AVAILABLE sct THEN
       DISP sct_det.sct_part sct_det.sct_site sct_det.sct_cst_tot sct_det.sct_mtl_ll
            sct_det.sct_lbr_tl sct_det.sct_bdn_tl sct.sct_site sct.sct_part sct.sct_mtl_tl
        WITH WIDTH 200 WITH STREAM-IO.


END.


/* FOR EACH sct_det NO-LOCK WHERE sct_det.sct_site = "530" AND sct_det.sct_sim = "standard" AND (sct_det.sct_part BEGINS "243" OR sct_det.sct_part BEGINS "231") : */
/*                                                                                                                                                                 */
/*     FIND FIRST sct NO-LOCK WHERE sct.sct_part = sct_det.sct_part AND sct.sct_site = "530" AND sct.sct_sim = "2005-12C" NO-ERROR.                                */
/*     IF AVAILABLE sct THEN                                                                                                                                       */
/*        DISP sct_det.sct_part sct_det.sct_sim sct_det.sct_site sct_det.sct_cst_tot sct_det.sct_mtl_ll sct_det.sct_lbr_tl sct_det.sct_bdn_tl                      */
/*                              sct.sct_sim sct.sct_site sct.sct_cst_tot sct.sct_mtl_ll sct.sct_lbr_tl sct.sct_bdn_tl                                              */
/*         WITH WIDTH 200 WITH STREAM-IO.                                                                                                                          */
/*                                                                                                                                                                 */
/*                                                                                                                                                                 */
/* END.                                                                                                                                                            */
